/**
 * Copyright (c) 2009  Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.penelope.ui.internal;

import static org.ops4j.peaberry.Peaberry.osgiModule;
import static org.ops4j.peaberry.Peaberry.service;
import static org.ops4j.peaberry.eclipse.EclipseRegistry.eclipseRegistry;
import static org.ops4j.peaberry.util.TypeLiterals.export;
import it.uniba.di.cdg.penelope.ui.EclipseSupportConfig;
import it.uniba.di.cdg.penelope.ui.lnf.EclipseUIHelper;
import it.uniba.di.cdg.penelope.ui.lnf.IEclipseUIHelper;

import com.google.inject.AbstractModule;

/**
 * Export UI helper services as OSGi services.
 */
public class ExportedServicesConfig extends AbstractModule {
	/* (non-Javadoc)
	 * @see com.google.inject.AbstractModule#configure()
	 */
	@Override
	protected void configure() {
		install( osgiModule( Activator.getDefault().getBundleContext(), eclipseRegistry() ) );
		install( new EclipseSupportConfig() );

		bind( export( IEclipseUIHelper.class ) ).toProvider( service( EclipseUIHelper.class ).export() );
	}
}
